/*
 * StringUtils.java
 * 
 * Created on Sep 19, 2007, 2:33:34 PM
 * 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.glossitope.container.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author joshy
 */
public class StringUtils {
    public static String substring(String target, String regex) {
        // strip off the external links
        Pattern pat = Pattern.compile(regex);
        Matcher matcher = pat.matcher(target);
        if(matcher.find()) {
            return matcher.group(1);
        }
        return null;
    }
}
